package com.xc.quickstart.admin.controller;

import com.xc.quickstart.admin.query.CrmConfigQuery;
import com.xc.quickstart.common.model.ApiResponse;
import com.xc.quickstart.mapper.entity.CrmConfigENT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import com.xc.quickstart.service.CrmConfigService;


/**
 * 通用配置
 * @author xc
 * @since 2021-04-20 11:47:08
 **/

@RestController
@RequestMapping("/crmConfigController")
public class CrmConfigController {

    @Autowired
    private CrmConfigService crmConfigService;

    @PostMapping("list")
    public ApiResponse selectPage(@RequestBody CrmConfigQuery query) {
      return crmConfigService.selectPage(query);
    }

    @PostMapping(value = "save")
    public ApiResponse save(@RequestBody CrmConfigENT entity) {
        return crmConfigService.save(entity);
    }

    @PostMapping(value = "update")
    public ApiResponse update(@RequestBody CrmConfigENT entity) {
        return crmConfigService.update(entity);
    }

    @PostMapping(value = "delete")
    public ApiResponse delete(@RequestParam("id") Integer id) {
        return crmConfigService.deleteById(id);
    }
}
